package com.company.woye.quantitycheck.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.company.woye.R;
import com.company.woye.checkmakesure.bean.LuBuDetailBean;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class QuantityCheckAdapter extends BaseAdapter {

    private LayoutInflater inflater;
    private Context mContext;
    private List<LuBuDetailBean.DataBean.DbhListBean> dbhListBeans;

    public QuantityCheckAdapter(Context context, List<LuBuDetailBean.DataBean.DbhListBean> dbhListBeans) {
        this.inflater = LayoutInflater.from(context);
        this.mContext = context;
        this.dbhListBeans = dbhListBeans;
    }

    @Override
    public int getCount() {
        return 20;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHodler = null;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.item_quantity_check, parent, false);
            viewHodler = new ViewHolder(convertView);
            convertView.setTag(viewHodler);
        } else {
            viewHodler = (ViewHolder) convertView.getTag();
        }
        return convertView;
    }


    class ViewHolder {
        @BindView(R.id.tv_num)
        TextView tvNum;
        @BindView(R.id.tv_ganghao)
        TextView tvGanghao;
        @BindView(R.id.tv_piece)
        TextView tvPiece;
        @BindView(R.id.tv_mldj)
        TextView tvMldj;
        @BindView(R.id.tv_sb)
        TextView tvSb;
        @BindView(R.id.tv_all_bad)
        TextView tvAllBad;
        @BindView(R.id.tv_result)
        TextView tvResult;
        @BindView(R.id.mylistitem)
        LinearLayout mylistitem;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
